<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>VIT 科技</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />    
    <link href="./css/bootstrap.min.css" rel="stylesheet" />
    <link href="./css/bootstrap-responsive.min.css" rel="stylesheet" />
    <link href="http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600" rel="stylesheet" />
    <link href="./css/font-awesome.css" rel="stylesheet" />
    <link href="./css/adminia.css" rel="stylesheet" /> 
    <link href="./css/adminia-responsive.css" rel="stylesheet" /> 
    <link href="./css/pages/login.css" rel="stylesheet" /> 
    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
	<script type="text/javascript">
    function checkup()
    {
    	var divshow = $("#showInfo2");
    	var username=	$("#username").val();
    	var password=$("#password").val();
    	
		if(username=='')
		{
			divshow.text("");// 清空数据
            divshow.append("<font color='red'>对不起用户名不能为空.</font>");
          	return false;
		}
		else
		{
			$.ajax({
			    url:"../login.php",//处理逻辑文件URL
			    type:'POST',//提交方式
			    data:"username="+username+"&password="+password,//参数
			    success: function(data) 
			    {
			    	 //data 返回数据
				     if($.parseJSON(data).uid)
				     {
				    		window.location ="../main.php";
				     }
				     else
				     {
					        divshow.text("");// 清空数据
					    	divshow.append($.parseJSON(data).message);
				     }
			    }
			 });
		}
    }
</script>
<body>
<div class="navbar navbar-fixed-top">
	<div class="navbar-inner">
		<div class="container">
			<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> 
				<span class="icon-bar"></span> 
				<span class="icon-bar"></span> 
				<span class="icon-bar"></span> 				
			</a>
			
			<a class="brand" href="index.php">轴承监控</a>
			
			<div class="nav-collapse">
			
				<ul class="nav pull-right">
					
					<li class="">
						<a href="index.php"><i class="icon-chevron-left"></i> Back to Homepage</a>
					</li>
				</ul>
				
			</div> <!-- /nav-collapse -->
			
		</div> <!-- /container -->
	</div> <!-- /navbar-inner -->
</div> <!-- /navbar -->
<div id="login-container">
	<div id="login-header">
		<h3>企业管理员</h3>
	</div> <!-- /login-header -->
	<div id="login-content" class="clearfix">
	<form name="form1" id="form1" action="#" method="post" enctype="multipart/form-data">
				<fieldset>
					<div class="control-group">
						<label class="control-label" for="username">登录名：</label>
						<div class="controls">
							<input type="text" class="" id="username" name="username" />
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="password">登录密码：</label>
						<div class="controls">
							<input type="password" class="" id="password" name="password"/>
						</div>
					</div>
				</fieldset>
				
				<div id="remember-me" class="pull-left">
					<text id="showInfo2">请输入您的用户名和密码</text>
				</div>
				
				<div class="pull-right">
					<button type="button" class="btn btn-warning btn-large" onclick="checkup();">
						Login
					</button>
				</div>
			</form>
		</div> <!-- /login-content -->
		<div id="login-extra">
			<p style="font-size:13px;color:red">淘宝用户登陆? <a href="tb_login.php">Login Up.</a></p>
		</div>
</div> <!-- /login-wrapper -->
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="./js/jquery-1.7.2.min.js"></script>
<script src="./js/bootstrap.js"></script>
  </body>
</html>